﻿using CommonTools;
using DataViews.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataViews.Configs
{
    public class FilterSampleConfig:ConfigBase<FilterSampleConfig>
    {
        protected override void _DefaultInit()
        {
            var items = new[]
            {                
                new {sample="xx",memo="包含'xx'【最常用】"},
                new {sample="xx*yy", memo="包含'xx'且包含'yy'【最常用】"},
                new {sample="xx*yy*zz", memo="同时包含'xx'、'yy'、'zz'"},
                new {sample="^xx",memo="以'xx'开头"},
                new {sample="xx$",memo="以'xx'结尾"},                
                

                new {sample="",memo=""},
                new {sample="xx#yy",memo="'xx' ≤ 文本 ≤ 'yy'"},
                new {sample="10#100",memo="10 ≤ 数字 ≤ 1000"},
                new {sample="2024-08-23#2024-09-01",memo="2024-08-23 ≤ 日期 ≤ 2024-9-1"},
                new {sample="2024-08-23 08:30:00#2024-08-24 12:45:00",memo="2024-08-23 08:30 ≤ 时间 ≤ 2024-8-24 12:45"},
                new {sample="10-12",memo="按字符串匹配，可以匹配2010-12-15和2024-10-12"},
                new {sample="11:23",memo="按字符串匹配，可以匹配2010-10-15 11:23:15和2024-10-12 19:11:23"},
                new {sample="",memo=""},

                new {sample="*",memo="符号说明：同时匹配2个或多个条件"},
                new {sample="^",memo="符号说明：开头"},
                new {sample="$",memo="符号说明：结尾"},
                new {sample="#",memo="符号说明：从...到..."},

            };

            
            foreach(var item in items)
            {
                var filter_sample = new FilterSampleItem();
                filter_sample.Sample = item.sample; 
                filter_sample.Memo=item.memo;
                FilterSamples.Add(filter_sample);
            }
        }

        public List<FilterSampleItem> FilterSamples { get; set; }=new List<FilterSampleItem>();
    }
}
